package com.myxfd.superweibo.services;

import com.myxfd.superweibo.model.TokenInfo;
import com.myxfd.superweibo.model.WeiboInfo;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by Lulu on 2016/10/26.
 */

public interface WeiboService {
    @FormUrlEncoded
    @POST("oauth2/access_token")
    Call<TokenInfo> getToken(
      @Field("client_id") String clientId,
      @Field("client_secret") String clientSecret,
      @Field("grant_type") String grantType,
      @Field("code") String code,
      @Field("redirect_uri") String uri
    );

    @GET("2/statuses/public_timeline.json")
    Call<WeiboInfo> getWeiboInfo(@Query("access_token") String token);


}
